{{extend 'layout.html'}}
<script src="{{=URL(r=request,c='static',f='table2CSV.js')}}" type="text/javascript"></script>

<h1>Income & Expense Report</h1>
<input value="Export table as CSV" type="button" onclick="$('#report').table2CSV()">
<table id='report'>
<thead>
<tr>
<th>Date</th><th>Description</th><th>Income</th><th>Expense</th><th>Balance</th></tr>
</thead>
{{for record in records:}}
<tr>
	<td>{{=record['rec_date']}}</td>
	<td>{{=record['description']}}</td>
	<td>{{=record['income']}}</td>
	<td>{{=record['expense']}}</td>
	<td>{{=record['balance']}}</td>
</tr>
{{pass}}
</table>